package com.znf4.controller.user.dto;
/*package com.bigpay.controller.user;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bigpay.bank.enums.BankWayEnum;
import com.bigpay.common.core.enums.MerchantStatusEnum;
import com.bigpay.common.core.enums.PayWayEnum;
import com.bigpay.common.core.enums.PublicStatusEnum;
import com.bigpay.user.entity.BatchMerchantPhone;
import com.bigpay.user.entity.RpUserSecondLevelMerchant;
import com.bigpay.user.enums.BusCategoryEnum;
import com.bigpay.user.service.BatchMerchantPhoneService;
import com.bigpay.user.service.RpUserSecondLevelMerchantService;

*//**
 * 批量报备时所需的报备手机号
 * @author Administrator
 *
 *//*
@Controller
public class BatchMerchantPhoneController {
	
	@Autowired
	private BatchMerchantPhoneService batchMerchantPhoneService;
	
	@Autowired
	private RpUserSecondLevelMerchantService rpUserSecondLevelMerchantService;
	
	*//**
	 * 报备-》下载密钥-》验卡 接口
	 * @return
	 *//*
	@ResponseBody
	@RequestMapping(value = "/start", method = { RequestMethod.POST, RequestMethod.GET })
	public String BatchSecondLevelMerchantStart(){
		String message = "本批二级商户报备成功！！";
		
		int index = 0;
		int offset = 10; //5万
		List<BatchMerchantPhone> list = batchMerchantPhoneService.listAll(index, offset);
		for(BatchMerchantPhone batchMerchantPhone : list){
			RpUserSecondLevelMerchant slm = new RpUserSecondLevelMerchant();
			
			String secondLevelMerchantName = batchMerchantPhone.getCompany().substring(0,20);
			
			String secondLevelMerchantShortName = secondLevelMerchantName.substring(0, secondLevelMerchantName.length()/2+1);
			
			System.out.println("secondLevelMerchantName:"+secondLevelMerchantName+"||secondLevelMerchantShortName:"+secondLevelMerchantShortName);
			
			//商户名称和简称一致
			slm.setSecondLevelMerchantName(secondLevelMerchantName); //二级商户全称
			slm.setSecondLevelMerchantShortName(secondLevelMerchantShortName); //二级商户简称
			
			slm.setBusiContactMobile(batchMerchantPhone.getPhone()); //手机号
			
			slm.setAddress("辽宁省大连市"); //商户地址
			slm.setBeginTradeTime(0); //开始交易时间
			slm.setEndTradeTime(24); //结束交易时间
			slm.setMixAmount(new BigDecimal(0)); //最小交易金额
			slm.setMaxAmount(new BigDecimal(10000)); //最大交易金额
			slm.setBankWayCode(BankWayEnum.LONGYANG.name()); //银行通道
			slm.setPayWayCode(PayWayEnum.ALIPAY.name()); //支付方式
			slm.setStatus(PublicStatusEnum.ACTIVE.name());
			slm.setManagementCategory(BusCategoryEnum.PWLY.name()); //经营类目
			String subMerchantNo = System.currentTimeMillis() + ""; //二级商户编号
			slm.setSecondLevelMerchantNo(subMerchantNo); //根据当前时间生成二级商户编号
			
			slm.setBankMerchantCode(subMerchantNo); //通道返回商户编码(在此用当前时间来设置商户编码)
			
			String forStatus = rpUserSecondLevelMerchantService.saveMerchantIn2(slm);
			if("NO".equals(forStatus)){
				continue ;
			}else{
				batchMerchantPhoneService.updateData(batchMerchantPhone);//修改版本号  0:代表未使用   >0:代表使用过多少次
			}
			
		}
		
		return message;
	}
	
	
	*//**
	 * 获取手机号进行报备
	 * @return
	 *//*
	@ResponseBody
	@RequestMapping(value = "/phoneList", method = { RequestMethod.POST, RequestMethod.GET })
	public String BatchMerchantPhoneList(){
		int index = 0; //开始处
//		int offset = 100000; //10万数据
		int offset = 5; //10万数据
		
		List<BatchMerchantPhone> list = batchMerchantPhoneService.listAll(index, offset);
		System.out.println("list------------------------>"+list.size());
		for(BatchMerchantPhone batchMerchantPhone : list){
			System.out.println(batchMerchantPhone.toString());
			//请求上游报备接口
			
			//判断返回报备是否成功
			
			//成功:请求上游下载私钥
			
			//私钥充足和不够
			
			//将该手机号和其他信息(下载的私钥)插入二级商户表中
			RpUserSecondLevelMerchant ruslm = new RpUserSecondLevelMerchant(); //二级商户实体
			ruslm.setSecondLevelMerchantNo("二级商户编号 "); //二级商户编号 
			ruslm.setSecondLevelMerchantName("二级商户全称"); //二级商户全称
			ruslm.setSecondLevelMerchantShortName("二级商户简称"); //二级商户简称
			ruslm.setAddress("商户地址"); //商户地址
			ruslm.setBusiContactMobile("手机号"); //手机号
			ruslm.setManagementCategory("经营类目"); //经营类目
			ruslm.setPayWayCode("支付方式"); //支付方式
			ruslm.setBankWayCode("银行通道"); //银行通道
			ruslm.setBankMerchantCode("通道返回商户编码"); //通道返回商户编码
			ruslm.setBankMerchantSecret("通道返回商户密钥"); //通道返回商户密钥
			ruslm.setMaxAmount(new BigDecimal(2000)); //最大交易金额
			ruslm.setMixAmount(new BigDecimal(20)); //最小交易金额
			ruslm.setBeginTradeTime(0); //开始交易时间
			ruslm.setEndTradeTime(24); //结束交易时间
			ruslm.setField1("field1"); //field1
			ruslm.setField2("field2"); //field1
			
			ruslm.setStatus(MerchantStatusEnum.ACTIVE.name());
			
			//next
			
			
			
			batchMerchantPhoneService.updateData(batchMerchantPhone);//修改版本号  0:代表未使用   >0:代表使用过多少次
		}
		
		String count = null;
		if(null != list && list.size()>0){
			count = String.valueOf(list.size());
		}else{
			count = "无数据";
		}
		
		return count;
	}
	
}
*/